import mongoengine as db

from app.db import BaseDocument


class News(BaseDocument):
    meta = {
        'collection': 'news',
        'ordering': ['-datetime'],
        'indexes': ['-datetime']
    }

    isSendNotification = db.BooleanField(default=False)
    isConsoleDisplay = db.BooleanField(default=False)
    isHomepageDisplay = db.BooleanField(default=False)
    isRecommendDisplay = db.BooleanField(default=False)
    isDraft = db.BooleanField(default=False)
    datetime = db.DateTimeField(default=False)
    author = db.StringField()
    title = db.StringField()
    type = db.StringField()
    link = db.StringField()
    summary = db.StringField()
    content = db.StringField()
    image = db.StringField()

